/**
 * Copyright (c) 快宝网络 kuaidihelp.com Co., Ltd. All Rights Reserved 禁止外泄以及用于其它的商业用途
 */

import request from '../utils/request';
import { serializeGetData } from '../utils/utils';

// 获取驿站列表
export async function getYzList() {
  return request('/Api/orderManage/WaybillSource/getSiteNameList', {
    method: 'GET',
  });
}
// 单号设置，获取业务员单号设置列表
export async function getSetterList(params) {
  return request(`/Api/orderManage/WaybillSource/getCourierList?${serializeGetData(params)}`, {
    method: 'GET',
  });
}
// 单号设置，单号源操作，获取业务员单号源数据
export async function getOperatorOrderSourceList(params) {
  return request('/Api/orderManage/WaybillSource/listWithBrand', {
    method: 'POST',
    body: params,
  });
}
// 单号设置，单号源操作，编辑单号设置
export async function editOrderSource(params) {
  return request('/Api/orderManage/WaybillSource/replaceRelation', {
    method: 'POST',
    body: params,
  });
}
// 单号设置，单号源操作，新增单号设置
export async function addOrderSource(params) {
  return request('/Api/orderManage/WaybillSource/addRelation', {
    method: 'POST',
    body: params,
  });
}
// 单号记录，获取单号记录列表
export async function getOrderRecordList(params) {
  return request(
    `/Api/orderManage/WaybillRecord/getRecordList?pageSize=100&${serializeGetData(params)}`,
    {
      method: 'GET',
      data: params,
    },
  );
}
// 单号记录，获取下载任务列表
export async function getDownloadTaskList(params) {
  return request(`/Api/orderManage/WaybillRecord/getTaskList?${serializeGetData(params)}`, {
    method: 'GET',
    data: params,
  });
}
// 单号记录，添加单号下载任务
export async function addDownLoadTask(params) {
  return request('/Api/orderManage/WaybillRecord/addTask', {
    method: 'POST',
    body: params,
  });
}
// 单号记录，订单详情
export async function getOrderRecordDetail(params) {
  return request(`/Api/orderManage/WaybillRecord/getOrderInfo?${serializeGetData(params)}`, {
    method: 'GET',
    data: params,
  });
}
// 单号使用统计，获取列表
export async function getStatisticsList(params) {
  return request('/Api/orderManage/WaybillRecord/waybillSourceStatistics', {
    method: 'POST',
    body: params,
  });
}
// 单号使用统计，查看明细
export async function getStatisticsDetailList(params) {
  return request('/Api/YZ/Fund/orderStatisticsDetail', {
    method: 'POST',
    body: params,
  });
}
// 单号使用统计，添加单号下载任务
export async function addDownLoad(params) {
  return request('/Api/orderManage/WaybillRecord/excelWaybillSourceStatistics', {
    method: 'POST',
    body: params,
  });
}
// 单号使用统计，获取下载任务列表
export async function getDownloadList(params) {
  return request('/Api/orderManage/WaybillRecord/excelWaybillSourceStatisticsList', {
    method: 'POST',
    body: params,
  });
}
// 微商，单号使用统计，添加单号下载任务
export async function wsAddDownLoad(params) {
  return request('/Api/DownTask/addTask', {
    method: 'POST',
    body: params,
  });
}
// 微商，单号使用统计，获取下载任务列表
export async function wsGetDownloadList(params) {
  return request(`/Api/DownTask/getTaskList?${serializeGetData(params)}`, {
    method: 'GET',
  });
}
// 代收货款管理
export async function getCollectionList(params) {
  return request('/Api/orderManage/CollectionOfPayment/collectionPaymentlist', {
    method: 'POST',
    body: params,
  });
}
// 代收货款管理，核销
export async function verifycatCollection(params) {
  return request('/Api/orderManage/CollectionOfPayment/collectionVerification', {
    method: 'POST',
    body: params,
  });
}
// 代收货款管理，已回款记录
export async function getPayBackList(params) {
  return request('/Api/orderManage/CollectionOfPayment/writeOffList', {
    method: 'POST',
    body: params,
  });
}
// 代收货款管理，未回款统计
export async function getNoPayBackList(params) {
  return request('/Api/orderManage/CollectionOfPayment/noWriteOffList', {
    method: 'POST',
    body: params,
  });
}
// 代收货款管理，查看详情
export async function getPaymentDetail(params) {
  return request('/Api/orderManage/CollectionOfPayment/detail', {
    method: 'POST',
    body: params,
  });
}
// 代收货款管理，下载表格
export async function getPaymentDownload(params) {
  return request(`/Api/orderManage/CollectionOfPayment/exportOrder?${serializeGetData(params)}`, {
    method: 'GET',
  });
}
// 客户管理
export async function getClientManagement(params) {
  return request('/Api/orderManage/Customer/customerList', {
    method: 'POST',
    body: params,
  });
}

// 客户管理, 添加客户信息
export async function addClientInfo(params) {
  return request('/Api/orderManage/Customer/addCustomer', {
    method: 'POST',
    body: params,
  });
}
// 客户管理, 编辑客户信息
export async function editClientInfo(params) {
  return request('/Api/orderManage/Customer/updateCustomer', {
    method: 'POST',
    body: params,
  });
}
// 客户管理, 删除客户信息
export async function deleteClientInfo(params) {
  return request('/Api/orderManage/Customer/deleteCustomer', {
    method: 'POST',
    body: params,
  });
}
// 客户管理, 获取客户信息
export async function getCourierInfo(params) {
  return request('/Api/orderManage/Customer/getCourierInfo', {
    method: 'POST',
    body: params,
  });
}
// 订单详情
export async function getOrderDetailList(params) {
  return request('/Api/YZ/Fund/getOrderDetailList', {
    method: 'POST',
    body: params,
  });
}
// 客户管理, 获取快递员级联信息
export async function getCascaderInfo(params) {
  return request('/Api/orderManage/Customer/getCourierInfoAll', {
    method: 'POST',
    body: params,
  });
}
// 微商管理
export async function getDerivativeManagement(params) {
  return request('/Api/Ws/wsInfo', {
    method: 'POST',
    body: params,
  });
}
// 根据手机号获取微商信息
export async function wsSearchPhone(params) {
  return request('/Api/Ws/searchPhone', {
    method: 'POST',
    body: params,
  });
}
// 根据微商id获取微商信息
export async function wsSearchId(params) {
  return request('/Api/Ws/getTblWsOne', {
    method: 'POST',
    body: params,
  });
}
// 编辑微商客户信息
export async function editDerivativeInfo(params) {
  return request('/Api/Ws/updateWs', {
    method: 'POST',
    body: params,
  });
}
// 删除微商客户信息
export async function deleteDerivativeInfo(params) {
  return request('/Api/Ws/deleteWs', {
    method: 'POST',
    body: params,
  });
}
// 新增微商客户信息
export async function addDerivativeInfo(params) {
  return request('/Api/Ws/addWs', {
    method: 'POST',
    body: params,
  });
}
// 微商 单号设置，获取业务员单号设置列表
export async function getWxSetterList(params) {
  return request(
    `/Api/orderManage/WaybillSource/getWechatMerchantList?${serializeGetData(params)}`,
    {
      method: 'GET',
    },
  );
}
// 微商 单号设置，单号源操作，编辑单号设置
export async function wsEditOrderSource(params) {
  return request('/Api/orderManage/WaybillSource/cityShareWechatUpdateRelation', {
    method: 'POST',
    body: params,
  });
}
// 单号设置，单号源操作，新增单号设置
export async function wsAddOrderSource(params) {
  return request('/Api/orderManage/WaybillSource/cityShareWechatRelation', {
    method: 'POST',
    body: params,
  });
}
// 微商单号记录
export async function getWsRecordList(params) {
  return request('/Api/WsWaybillStatistics/wsWayBillLog', {
    method: 'POST',
    body: params,
  });
}
// 微商单号使用统计
export async function getWsStatisticsList(params) {
  return request('/Api/WsWaybillStatistics/wsWayBillStatisticsLog', {
    method: 'POST',
    body: params,
  });
}
// 微商订单详情
export async function getWsOrderDetail(params) {
  return request('/Api/WsWaybillStatistics/wsWayBillDetail', {
    method: 'POST',
    body: params,
  });
}
// 驿站 单号设置，获取业务员单号设置列表
export async function getYzSetterList(params) {
  return request('/Api/orderManage/WaybillSource/getInnerList', {
    method: 'POST',
    body: params,
  });
}
// 驿站 单号设置，获取业务员单号设置列表
export async function yzEditOrderSource(params) {
  return request('/Api/orderManage/WaybillSource/addInnerSource', {
    method: 'POST',
    body: params,
  });
}
// 驿站单号记录
export async function getYZRecordList(params) {
  return request('/Api/orderManage/WaybillRecord/getInnRecordList', {
    method: 'POST',
    body: params,
  });
}
// 驿站单号使用统计
export async function getYZStatisticsList(params) {
  return request('/Api/orderManage/WaybillRecord/waybillSourceInnStatistics', {
    method: 'POST',
    body: params,
  });
}
// 驿站，单号使用统计，添加单号下载任务
export async function yzAddDownLoad(params) {
  return request('/Api/DownTask/YZddTask', {
    method: 'POST',
    body: params,
  });
}
// 驿站，单号使用统计，获取下载任务列表
export async function yzGetDownloadList(params) {
  return request('/Api/DownTask/YZgetTaskList', {
    method: 'POST',
    body: params,
  });
}
// 驿站订单详情
export async function yzGetOrderDetail(params) {
  return request('/Api/WsWaybillStatistics/yzWayBillDetail', {
    method: 'POST',
    body: params,
  });
}

// 单号设置，单号充值记录
export async function getOrderChargeRecords(params) {
  return request('/Api/orderManage/WaybillRecord/waybillSourceLog', {
    method: 'POST',
    body: params,
  });
}
